package cn.com.baiwei.controller;

import cn.com.baiwei.service.impl.FileUpLoadServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Map;

/**
 * @description: 上传图片
 * @author: X_Q
 * @create: 2021-09-18 13:03
 **/
@RestController
@Api(value = "上传管理",tags = "文件(图片)上传管理接口API")
public class UploadController {
    @Resource
    private FileUpLoadServiceImpl fileUpLoadService;

    @PostMapping("/uploadPicture")
    @ApiOperation(value = "图片上传接口",notes = "图片上传")
    public Map<String ,Object> uploadPicture(MultipartFile file, HttpServletRequest request)throws SQLException, IOException, ClassNotFoundException{
        return fileUpLoadService.fileUpLoad(file,request);
    }


}
